/*******************************************************************************
*funtion: 
*date	:	
*author	:
*modify	:
*note	:
*******************************************************************************/
#define WIN32_LEAN_AND_MEAN

#include "DevicePlugin.h"


#include <string>
using namespace std;

class  HikPlugin : public DevicePlugin
{
public:
    HikPlugin();
    ~HikPlugin();

private:
enum VideoType
{
	H264 = 1,
	MPEG4,
	MJEPG,	
};

enum AudioType
{
	AAC  = 1,
	MP3,
	G711,
	G723
};

public:
    virtual int init();
    virtual int fini();
    virtual int login(string& id,string& ip,unsigned short port,string& user,string& pass);
    virtual int logout();

	virtual int openLive(int devid,int channel,int streamType );
	virtual long openLive(long userID,long channel);
    virtual long closeLive(long streamID);
	virtual long queryRecord(long userID,long channel,int y,int m,int d,vector<RecordTime>& vecRecord);
	virtual long openVod(long userID,long channel,string& strSTime,string& strETime);

//	std::string getCompany() const;
    //virtual int openVodVideo();
    //virtual int play();
    //virtual int pause();
    //virtual int seek();	
    //virtual int closeVodVideo();
    //virtual int openAudioVideo();
    //virtual int closeAudioVideo();
	//send data to socket of client directly
    virtual int sendVideo(char* pBuffer,int bufSize,int videoType=H264);
    //virtual int sendAudio(char* pBuffer,int bufSize,int audioType=H264);
    //virtual int  recvAudio(char* pBuffer,int bufSize,void* param, int AAC);
	//buffer data to fifo,and activate threadpool to send data of fifo
    virtual int bufferVideo(int devid,char * pBuffer, int bufSize,int videoType=H264);
    //virtual int bufferAudio(int devid,char * pBuffer, int bufSize,int videoType=H264);

	//void setDest(std::string& ip,short port);
private:
    //virtual int sendRtpOverUdp();
    //virtual int sendRtpOverTcp();
    //virtual int sendRtpOverHttp();
    //virtual int sendRaw();
    //virtual int recvLiveStream();
    //virtual int recvVodStream();
	//DvrInfo_S *dvrInfo;
	//std::string m_dstIP;
	//short		m_dstPort;
	//DatagramSocket	m_udpSender;
public:
//	static FILE* fp ;
};
